package com.cj.web.before;

import com.cj.entity.Coursedetail;
import com.cj.service.CourseDetailService;
import com.cj.utils.JSONUtils;
import com.cj.web.BaseServlet;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @Auther: chenjie
 * @Date: 2021/7/14 - 07 - 14 - 14:24
 * @Description: com.cj.web.before
 */
@WebServlet("/courseDetailWeb")
public class CourseDetailServlet extends BaseServlet {
    CourseDetailService service = new CourseDetailService();
//    查找课程细节
    public void findCourseDetail(HttpServletRequest req, HttpServletResponse resp) throws IOException {
        String cid = req.getParameter("cid");

        Map<String, List<Coursedetail>> map = service.findCourseDetail(cid);


        JSONUtils.objToJson(map,resp);

    }
}
